<?php

class Admin_Form_Guest extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post');
        $this->setAttrib('class', 'validate-form');
        
        $this->addElement('text','txtAgent',array(
        			'label'		=> 'Người đại diện: ',
        			'required'	=> TRUE,
        			'class'		=> 'required'
        		));        
        $this->addElement('text','txtOffice',array(
        			'label'		=> 'Chức vụ: ',
        			'required'	=> TRUE,
        			'class'		=> 'required'
        		));
        $this->addElement('text','txtOrganization',array(
        			'label'		=> 'Tổ chức: ',
        			'required'	=> TRUE,
        			'class'		=> 'required'
        		));
        $this->addElement('text','txtAddress',array(
        			'label'		=> 'Địa chỉ: ',
        			'required'	=> TRUE,
        			'class'		=> 'required'
        		));
        $this->addElement('text','txtPhone',array(
        			'label'		=> 'Điện thoại: ',
        			'required'	=> TRUE,
        			'class'		=> 'required number'
        		));
        $this->addElement('text','txtEmail',array(
        			'label'		=> 'Email: ',
        			'required'	=> TRUE,
        			'class'		=> 'required email'
        		));
        $this->addElement('text','txtFax',array(
        			'label'		=> 'Fax: ',
        			'required'	=> TRUE,
        			'class'		=> 'required number'
        		));
        $this->addElement('text','txtAgent',array(
        			'label'		=> 'Quốc gia: ',
        			'required'	=> TRUE,
        			'class'		=> 'required'
        		));
        
    }

	/**
     * 
     * Set action cho form
     * @param unknown_type $actionName: ten cua action
     */
    function addAction($module,$controller, $actionName){
    	$this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl()."/".$module."/".$controller."/".$actionName);
    }
    
    /**
     * 
     * Add nut submit 
     */
    function addSubmitButton($name, $label){
    	$this->addElement('submit',$name,array(
    						'label'		=>	$label,
    						'decorators'=>	array('ViewHelper',array('HtmlTag',array(
    																			'tag' => 'dd' //giu nguyen the dd ko them bat cu the j
    																		)
    														
    															)
    							
    										),
    						'class'		=>	'input-hover uSubmit'	
    					));
    	
    }
    
    function addHiddenId($name,$value){
    	$this->addElement('hidden',$name,array(
			    				'value'	=> $value	
    						));
    }
    

	private function getAllMenu2(){
    	$menu2 = new Admin_Model_Menu2();
    	$menu2 = $menu2->fetchAllMenu2();
    	$arrData = array();
    	foreach ($menu2 as $value) {
    		$arrData[$value['menu2Id']] =$value['tenMenu2']	;
    	}
    	return $arrData;
    }
}

